#ifndef __ESL_DISPATCHER_H__
#define __ESL_DISPATCHER_H__

#include <esl.h>

class ESLDispatcher 
{
public:
    bool connect();
    bool sendEvent(const char *command);

    ESLDispatcher(const char *host, signed int port, const char *user, const char *pass):
        _host(const_cast<char*>(host)), 
        _port(port), 
        _user(const_cast<char*>(user)), 
        _pass(const_cast<char*>(pass))
    {
        _handle = new esl_handle_t;
    };

    ~ESLDispatcher() 
    {
        esl_disconnect(_handle);
        if(_handle) delete _handle;
    }

protected:
    char          *_host;
    char          *_user;
    char          *_pass;
    int            _port;
    esl_handle_t  *_handle;
};

#endif
